package cn.lili.modules.goods.mapper;

import cn.lili.modules.goods.entity.dos.StoreGoodsLabel;
import cn.lili.modules.goods.entity.dto.StoreGoodsLabelDTO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 店铺商品分类数据处理层
 *
 * @author pikachu
 * @since 2020-03-07 09:18:56
 */
public interface StoreGoodsLabelMapper extends BaseMapper<StoreGoodsLabel> {


    /**
     * 查询免税店铺分类
     * @return
     */
    @Select("SELECT goodLabel.* FROM lilishop_goods.li_store_goods_label AS goodLabel \n " +
            "JOIN  lilishop_user.li_store AS s ON s.id = goodLabel.store_id\n " +
            "WHERE s.is_free = 1 AND goodLabel.parent_id = 0 ")
    Page<StoreGoodsLabel> selectFreeTaxGoodsLabellist(Page page, @Param("dto") StoreGoodsLabelDTO dto);
}
